package yunhe.entity;



import java.awt.Color;
import java.awt.Graphics;

import yunhe.util.Global;

/**
 * 障碍物
 * @author Administrator
 *
 */
public class Ground {
	private int[][] rocks=new int[Global.WIDTH][Global.HEIGHT];
	public Ground(){
		for (int y = 0; y < Global.HEIGHT; y++) {
			for (int x = 0; x < Global.WIDTH; x++) {
				if (y==0 || y==Global.HEIGHT-1 || x==0||x==Global.WIDTH-1) {
					rocks[y][x]=1;
				}
			}
		}
	}
	/**
	 * 障碍物的显示
	 */
	public void showMe(Graphics g){
		System.out.println("障碍物出现");
		g.setColor(Color.pink);
		for (int y = 0; y < Global.HEIGHT; y++) {
			for (int x = 0; x < Global.WIDTH; x++) {
				if (rocks[y][x]==1) {
					g.fill3DRect(x*Global.CELL_SIZE, y*Global.CELL_SIZE, Global.CELL_SIZE, Global.CELL_SIZE, true);
				}
			}
		}
		
	}
	/**
	 * 蛇是否碰到障碍物
	 */
	public boolean isMovebySnake(Snake snake){
		System.out.println("判断是否碰到障碍物");
		return false;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
